{% extends "manage.html" %}
{% set current_nav = 'entry' %}

{% block body %}
<section class="hero is-primary">
  <div class="hero-body">
    <header class="container">
      <h1 class="title is-1">{{_('Entries')}}</h1>
      <div>
        <a class="button is-info"
           href="{{url_for('.entry')}}">
          {{_('New Entry')}}
        </a>
        <a class="button is-light"
           href="{{url_for('.refresh_keys')}}">
          {{_('Refresh Keywords')}}
        </a>
        {% for st_entry in statics %}
        <a class="button is-info is-inverted is-outlined"
           href="{{url_for('.entry', _id=st_entry._id)}}">
          {{st_entry._id}}
        </a>
        {% endfor %}
      </div>
    </header>
  </div>
</section>
<section class="section">
  <div class="container">
    <table class="table is-striped is-fullwidth">
      <thead>
        <tr>
          <th><abbr title="No.">{{_('NO.')}}</abbr></th>
          <th>{{_('File name / ID')}}</th>
          <th>{{_('Keywords')}}</th>
          <th>{{_('Action')}}</th>
        </tr>
      </thead>
      <tbody>
        {% for entry in entries %}
        <tr>
          <td>{{loop.index0}}</td>
          <td>{{entry._id}}</td>
          <td>{{entry.keywords|join(', ')}}</td>
          <td>
            <a class="button is-info"
               href="{{url_for('.entry', _id=entry._id)}}">
              {{_('Edit')}}
            </a>
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
</section>
{% endblock %}